using Microsoft.Expression.Drawing.Core;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
namespace Microsoft.Expression.Controls
{
	internal class RectangleStrategy : ShapeStrategy
	{
		private Rectangle sourceRectangle;
		private static readonly DependencyProperty RadiusXListenerProperty = DependencyProperty.Register("RadiusXListener", typeof(double), typeof(RectangleStrategy), new PropertyMetadata(new PropertyChangedCallback(GeometryStrategy.LayoutPropertyChanged)));
		private static readonly DependencyProperty RadiusYListenerProperty = DependencyProperty.Register("RadiusYListener", typeof(double), typeof(RectangleStrategy), new PropertyMetadata(new PropertyChangedCallback(GeometryStrategy.LayoutPropertyChanged)));
		private double RadiusXListener
		{
			get
			{
				return (double)base.GetValue(RectangleStrategy.RadiusXListenerProperty);
			}
			set
			{
				base.SetValue(RectangleStrategy.RadiusXListenerProperty, value);
			}
		}
		private double RadiusYListener
		{
			get
			{
				return (double)base.GetValue(RectangleStrategy.RadiusYListenerProperty);
			}
			set
			{
				base.SetValue(RectangleStrategy.RadiusYListenerProperty, value);
			}
		}
		public RectangleStrategy(LayoutPath layoutPath) : base(layoutPath)
		{
			this.sourceRectangle = (Rectangle)layoutPath.SourceElement;
			base.SetListenerBinding(RectangleStrategy.RadiusXListenerProperty, "RadiusX");
			base.SetListenerBinding(RectangleStrategy.RadiusYListenerProperty, "RadiusY");
		}
		public override IList<GeneralTransform> ComputeTransforms()
		{
			return null;
		}
		protected override PathGeometry UpdateGeometry()
		{
			RectangleGeometry rectangleGeometry = new RectangleGeometry();
			rectangleGeometry.set_Rect(new Rect(default(Point), base.Size));
			rectangleGeometry.set_RadiusX(this.sourceRectangle.get_RadiusX());
			rectangleGeometry.set_RadiusY(this.sourceRectangle.get_RadiusY());
			return rectangleGeometry.AsPathGeometry();
		}
	}
}
